<?php

//dropoffTimes model
//manages DB end of dropoffTimes

class dropoffs extends Model{

  var $name = "dropoffs";
  
  var $hasOne = array( "delivery" );
  
  function findCurrentDropoffs() {
    $doffs = $this->findAll("delivery_id = " . CURRENT_DELIVERY_ID, null, "start_time ASC");
    if (count($doffs == 0)) {
      $doffs = $this->findAll("delivery_id = 0", null, "start_time ASC");
    }
    return $doffs;
  }
}

?>
